#!/bin/bash

if [ "$1" == "0" ];then
    mb-objcopy -O srec ../hw/sdk/app/Debug/app.elf ./app.srec
else
    promgen -p mcs -u 0 ../hw/fusion/dpsm_top.bit -data_file up 200000 ./app.srec -spi -o outfile_$1.mcs
    promgen -p hex -r outfile_$1.mcs -o test_$1.hex
    #promgen -p mcs -u 0 ../top.bit -o outfile.mcs
fi
